<template>
    <view class="page-content">
        <sub-navbar title="个人信息"></sub-navbar>
        <view class="main-view">
            <view class="avatar-top">
                <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
                    <up-image :src="avatar" width="80px" height="80px" shape="circle"></up-image>
                    <text>更换头像</text>
                </button>
            </view>
            <view class="box-view">
                <view class="item-view">
                    <text>用户姓名</text>
                    <view class="right">
                        <text>测试001</text>
                        <view>
                            <up-icon name="arrow-right" color="#939099" size="18"></up-icon>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const avatar = ref<any>('')

const onChooseAvatar = (e: any) => {
    let { avatarUrl } = e.detail;
    avatar.value = avatarUrl
}

</script>

<style lang="scss" scoped>
.main-view{ 
    flex: 1;
    padding: 0 25rpx;
    background-color: #efefef;
    .avatar-top{
        margin-top: 25rpx;
        display: flex;
        flex-direction: column;
        padding: 25rpx 0;
        margin-bottom: 50rpx;
        align-items: center;
        background-color: #FFFFFF;
        border-radius: 12rpx;
        .avatar-wrapper{
            background-color: transparent !important;
            font-size: 26rpx;
            color: #606266;
            &::after{
                border: none !important;
            }
        }
    }
    .box-view{
        background-color: #FFFFFF;
        border-radius: 12rpx;
        padding: 0 25rpx;
        margin-bottom: 25rpx;
        &:last-child{
            margin-bottom: 0;
        }
        .item-view{
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 28rpx;
            color: #606266;
            padding: 25rpx 0;
            border-bottom: 1rpx solid #ceccca;
            &:last-child{
                border-bottom: none;
            }
            .right{
                display: flex;
                justify-content: flex-end;
            }
        }
    }
}
</style>